﻿/*-----------------------------------------------
// File: BCCelebrateState.cs
// Description: 
// Author: Shaobing	492057342@qq.com
-----------------------------------------------*/
using UnityEngine;
using System.Collections;

namespace Battle.View
{
    public class BCCelebrateState : Fsm.FsmStateMonoBase<ActorState>
    {
        BattleCharacter bc {
            get { return this.controller as BattleCharacter; }
        }
        public BCCelebrateState(ActorState state, BattleCharacter ctrl) : base(state, ctrl) { }

        public override void Enter()
        {
            var skill1 = bc.GetSkill(SkillType.Skill1);
            if (skill1 != null) {
                skill1.StopSkillAudio();
            }
            var skill2 = bc.GetSkill(SkillType.Skill2);
            if (skill2 != null) {
                skill2.StopSkillAudio();
            }
            var ultiSkill = bc.GetSkill(SkillType.Ultimate);
            if (ultiSkill != null) {
                ultiSkill.StopSkillAudio();
            }
            bc.buffTransform0.Hide();

            if (BattleViewCtrl.GetInstance().winCamp == bc.camp)
            {
                if (bc.isAlive)
                {
                    bc.PlayCelebrate();
                    bc.transform.localPosition = bc.GetStandPosition();
                }
            }
            else {
                bc.HideModel();
            }
        }
    }
}